using System;
using System.Collections.Generic;

namespace IQIGame.Onigao.Framework
{
    public class SInputStream : IDisposable
    {
#if UNITY_EDITOR
        ~SInputStream()
        {
            if (UnityEditor.EditorApplication.isPlaying)
            {
                if (_buffer != null)
                {
                    LogGame.LogError("SInputStream is not be dispose!!!");
                }
            }
        }
#endif
        private SiByteBuffer _buffer;

        public SInputStream() { }

        public void Init(byte[] buf, int offset, int length)
        {
            if (_buffer == null)
            {
                _buffer = SiByteBuffer.Wrap(buf, offset, length);
            }
            else
            {
                _buffer.Init(buf, offset, length);
            }
        }

        public bool HasRemaining()
        {
            return _buffer.HasRemaining();
        }

        public void SkipBinary()
        {
            byte identity = _buffer.Read();
            switch ((byte)(identity & 0xf0))
            {
                case SType.NULL:
                    break;
                case SType.BOOLEAN:
                    break;
                case SType.BYTE:
                case SType.UBYTE:
                    if ((identity & 0x01) != 0)
                    {
                        _buffer.ReaderIndex++;
                    }
                    break;
                case SType.SHORT:
                case SType.USHORT:
                    for (int i = 0; i < 2; ++i)
                    {
                        if ((identity & 0x01 << i) != 0)
                        {
                            _buffer.ReaderIndex++;
                        }
                    }
                    break;
                case SType.INT:
                case SType.UINT:
                case SType.FLOAT:
                    for (int i = 0; i < 4; ++i)
                    {
                        if ((identity & 0x01 << i) != 0)
                        {
                            _buffer.ReaderIndex++;
                        }
                    }
                    break;
                case SType.DOUBLE:
                case SType.LONG:
                    int valueCount = identity & 0x0f;
                    _buffer.ReaderIndex += valueCount;
                    break;
                case SType.STRING:
                case SType.BYTES:
                    {
                        int length = (int)_buffer.ReadSize(identity);
                        _buffer.ReaderIndex += length;
                        break;
                    }
                case SType.MAP:
                    {
                        uint length = _buffer.ReadSize(identity);
                        for (int i = 0; i < length; i++)
                        {
                            SkipBinary();
                            SkipBinary();
                        }
                        break;
                    }
                case SType.LIST:
                    {
                        uint length = _buffer.ReadSize(identity);
                        for (int i = 0; i < length; i++)
                        {
                            SkipBinary();
                        }
                        break;
                    }
                case SType.POD:
                    {
                        int length = _buffer.ReadInt();
                        _buffer.ReaderIndex += length;
                        break;
                    }
                default:
                    throw new Exception($"not support type = {identity}");
            }
        }

        public byte ReadByte()
        {
            return _buffer.Read();
        }

        public int Size
        {
            get
            {
                return _buffer.Size;
            }
        }

        public int Capacity
        {
            get
            {
                return _buffer.Capacity;
            }
        }

        public byte Read_ubyte()
        {
            return _buffer.Read_ubyte();
        }

        public sbyte Read_byte()
        {
            return _buffer.Read_byte();
        }

        public bool Read_boolean()
        {
            return _buffer.Read_boolean();
        }

        public short Read_short()
        {
            return _buffer.Read_short();
        }

        public ushort Read_ushort()
        {
            return _buffer.Read_ushort();
        }

        public int Read_int()
        {
            return _buffer.Read_int();
        }

        public int[] Read_intArr()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to arr");
            }
            uint length = _buffer.ReadSize(identity);
            int[] arr = new int[(int)length];
            for (uint i = 0; i < length; i++)
            {
                arr[i] = _buffer.Read_int();
            }
            return arr;
        }

        public uint Read_uint()
        {
            return _buffer.Read_uint();
        }

        public long Read_long()
        {
            return _buffer.Read_long();
        }

        public float Read_float()
        {
            return _buffer.Read_float();
        }

        public double Read_double()
        {
            return _buffer.Read_double();
        }

        public string Read_string()
        {
            return _buffer.Read_string();
        }

        public byte[] Read_bytes()
        {
            return _buffer.Read_bytes();
        }

        public Span<byte> Read_bytes_span()
        {
            return _buffer.Read_bytes_span();
        }

        public byte[] ToByteArray()
        {
            return _buffer.ToByteArray();
        }

        public T Read_pod<T>(Func<T> factory) where T : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return default;
            }
            if ((byte)(identity & 0xf0) != SType.POD)
            {
                throw new Exception("can't convert to pod");
            }
            int length = _buffer.ReadInt();
            int oldReadIndex = _buffer.ReaderIndex;
            int oldWriteIndex = _buffer.WriterIndex;
            _buffer.WriterIndex = oldReadIndex + length;
            T t = factory();
            t.UnSerial(this);
            _buffer.WriterIndex = oldWriteIndex;
            _buffer.ReaderIndex = oldReadIndex + length;
            return t;
        }

        public List<T> Read_list_pod<T>(List<T> list, Func<T> factory) where T : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(Read_pod<T>(factory));
            }
            return list;
        }

        public List<T> Read_list_pod<T>(Func<T> factory) where T : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<T> list = new List<T>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(Read_pod<T>(factory));
            }
            return list;
        }

        public Dictionary<K, V> Read_map_pod_pod<K, V>(Dictionary<K, V> map, Func<K> kFactory, Func<V> vFactory) where K : IPOD where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(kFactory), Read_pod<V>(vFactory));
            }
            return map;
        }

        public Dictionary<K, V> Read_map_pod_pod<K, V>(Func<K> kFactory, Func<V> vFactory) where K : IPOD where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, V> map = new Dictionary<K, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(kFactory), Read_pod<V>(vFactory));
            }
            return map;
        }

        public void Clear()
        {
            if (_buffer != null)
            {
                _buffer.Clear();
            }
        }

        public void Dispose()
        {
            if (_buffer != null)
            {
                _buffer.Dispose();
                _buffer = null;
            }
        }

        #region code gen


        public Dictionary<bool, bool> Read_map_boolean_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, bool> map = new Dictionary<bool, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<bool, sbyte> Read_map_boolean_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, sbyte> map = new Dictionary<bool, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<bool, byte> Read_map_boolean_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, byte> map = new Dictionary<bool, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<bool, short> Read_map_boolean_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, short> map = new Dictionary<bool, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<bool, ushort> Read_map_boolean_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, ushort> map = new Dictionary<bool, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<bool, int> Read_map_boolean_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, int> map = new Dictionary<bool, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<bool, uint> Read_map_boolean_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, uint> map = new Dictionary<bool, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<bool, float> Read_map_boolean_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, float> map = new Dictionary<bool, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<bool, double> Read_map_boolean_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, double> map = new Dictionary<bool, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<bool, long> Read_map_boolean_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, long> map = new Dictionary<bool, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<bool, string> Read_map_boolean_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, string> map = new Dictionary<bool, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<bool, byte[]> Read_map_boolean_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, byte[]> map = new Dictionary<bool, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<sbyte, bool> Read_map_byte_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, bool> map = new Dictionary<sbyte, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<sbyte, sbyte> Read_map_byte_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, sbyte> map = new Dictionary<sbyte, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<sbyte, byte> Read_map_byte_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, byte> map = new Dictionary<sbyte, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<sbyte, short> Read_map_byte_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, short> map = new Dictionary<sbyte, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<sbyte, ushort> Read_map_byte_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, ushort> map = new Dictionary<sbyte, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<sbyte, int> Read_map_byte_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, int> map = new Dictionary<sbyte, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<sbyte, uint> Read_map_byte_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, uint> map = new Dictionary<sbyte, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<sbyte, float> Read_map_byte_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, float> map = new Dictionary<sbyte, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<sbyte, double> Read_map_byte_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, double> map = new Dictionary<sbyte, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<sbyte, long> Read_map_byte_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, long> map = new Dictionary<sbyte, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<sbyte, string> Read_map_byte_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, string> map = new Dictionary<sbyte, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<sbyte, byte[]> Read_map_byte_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, byte[]> map = new Dictionary<sbyte, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<byte, bool> Read_map_ubyte_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, bool> map = new Dictionary<byte, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<byte, sbyte> Read_map_ubyte_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, sbyte> map = new Dictionary<byte, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<byte, byte> Read_map_ubyte_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, byte> map = new Dictionary<byte, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<byte, short> Read_map_ubyte_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, short> map = new Dictionary<byte, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<byte, ushort> Read_map_ubyte_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, ushort> map = new Dictionary<byte, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<byte, int> Read_map_ubyte_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, int> map = new Dictionary<byte, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<byte, uint> Read_map_ubyte_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, uint> map = new Dictionary<byte, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<byte, float> Read_map_ubyte_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, float> map = new Dictionary<byte, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<byte, double> Read_map_ubyte_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, double> map = new Dictionary<byte, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<byte, long> Read_map_ubyte_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, long> map = new Dictionary<byte, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<byte, string> Read_map_ubyte_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, string> map = new Dictionary<byte, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<byte, byte[]> Read_map_ubyte_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, byte[]> map = new Dictionary<byte, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<short, bool> Read_map_short_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, bool> map = new Dictionary<short, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<short, sbyte> Read_map_short_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, sbyte> map = new Dictionary<short, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<short, byte> Read_map_short_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, byte> map = new Dictionary<short, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<short, short> Read_map_short_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, short> map = new Dictionary<short, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<short, ushort> Read_map_short_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, ushort> map = new Dictionary<short, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<short, int> Read_map_short_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, int> map = new Dictionary<short, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<short, uint> Read_map_short_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, uint> map = new Dictionary<short, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<short, float> Read_map_short_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, float> map = new Dictionary<short, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<short, double> Read_map_short_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, double> map = new Dictionary<short, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<short, long> Read_map_short_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, long> map = new Dictionary<short, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<short, string> Read_map_short_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, string> map = new Dictionary<short, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<short, byte[]> Read_map_short_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, byte[]> map = new Dictionary<short, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<ushort, bool> Read_map_ushort_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, bool> map = new Dictionary<ushort, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<ushort, sbyte> Read_map_ushort_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, sbyte> map = new Dictionary<ushort, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<ushort, byte> Read_map_ushort_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, byte> map = new Dictionary<ushort, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<ushort, short> Read_map_ushort_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, short> map = new Dictionary<ushort, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<ushort, ushort> Read_map_ushort_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, ushort> map = new Dictionary<ushort, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<ushort, int> Read_map_ushort_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, int> map = new Dictionary<ushort, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<ushort, uint> Read_map_ushort_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, uint> map = new Dictionary<ushort, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<ushort, float> Read_map_ushort_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, float> map = new Dictionary<ushort, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<ushort, double> Read_map_ushort_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, double> map = new Dictionary<ushort, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<ushort, long> Read_map_ushort_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, long> map = new Dictionary<ushort, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<ushort, string> Read_map_ushort_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, string> map = new Dictionary<ushort, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<ushort, byte[]> Read_map_ushort_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, byte[]> map = new Dictionary<ushort, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<int, bool> Read_map_int_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, bool> map = new Dictionary<int, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<int, sbyte> Read_map_int_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, sbyte> map = new Dictionary<int, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<int, byte> Read_map_int_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, byte> map = new Dictionary<int, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<int, short> Read_map_int_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, short> map = new Dictionary<int, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<int, ushort> Read_map_int_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, ushort> map = new Dictionary<int, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<int, int> Read_map_int_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, int> map = new Dictionary<int, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<int, uint> Read_map_int_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, uint> map = new Dictionary<int, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<int, float> Read_map_int_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, float> map = new Dictionary<int, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<int, double> Read_map_int_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, double> map = new Dictionary<int, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<int, long> Read_map_int_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, long> map = new Dictionary<int, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<int, string> Read_map_int_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, string> map = new Dictionary<int, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<int, byte[]> Read_map_int_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, byte[]> map = new Dictionary<int, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<uint, bool> Read_map_uint_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, bool> map = new Dictionary<uint, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<uint, sbyte> Read_map_uint_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, sbyte> map = new Dictionary<uint, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<uint, byte> Read_map_uint_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, byte> map = new Dictionary<uint, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<uint, short> Read_map_uint_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, short> map = new Dictionary<uint, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<uint, ushort> Read_map_uint_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, ushort> map = new Dictionary<uint, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<uint, int> Read_map_uint_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, int> map = new Dictionary<uint, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<uint, uint> Read_map_uint_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, uint> map = new Dictionary<uint, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<uint, float> Read_map_uint_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, float> map = new Dictionary<uint, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<uint, double> Read_map_uint_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, double> map = new Dictionary<uint, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<uint, long> Read_map_uint_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, long> map = new Dictionary<uint, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<uint, string> Read_map_uint_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, string> map = new Dictionary<uint, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<uint, byte[]> Read_map_uint_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, byte[]> map = new Dictionary<uint, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<float, bool> Read_map_float_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, bool> map = new Dictionary<float, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<float, sbyte> Read_map_float_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, sbyte> map = new Dictionary<float, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<float, byte> Read_map_float_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, byte> map = new Dictionary<float, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<float, short> Read_map_float_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, short> map = new Dictionary<float, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<float, ushort> Read_map_float_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, ushort> map = new Dictionary<float, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<float, int> Read_map_float_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, int> map = new Dictionary<float, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<float, uint> Read_map_float_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, uint> map = new Dictionary<float, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<float, float> Read_map_float_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, float> map = new Dictionary<float, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<float, double> Read_map_float_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, double> map = new Dictionary<float, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<float, long> Read_map_float_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, long> map = new Dictionary<float, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<float, string> Read_map_float_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, string> map = new Dictionary<float, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<float, byte[]> Read_map_float_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, byte[]> map = new Dictionary<float, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<double, bool> Read_map_double_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, bool> map = new Dictionary<double, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<double, sbyte> Read_map_double_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, sbyte> map = new Dictionary<double, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<double, byte> Read_map_double_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, byte> map = new Dictionary<double, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<double, short> Read_map_double_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, short> map = new Dictionary<double, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<double, ushort> Read_map_double_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, ushort> map = new Dictionary<double, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<double, int> Read_map_double_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, int> map = new Dictionary<double, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<double, uint> Read_map_double_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, uint> map = new Dictionary<double, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<double, float> Read_map_double_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, float> map = new Dictionary<double, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<double, double> Read_map_double_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, double> map = new Dictionary<double, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<double, long> Read_map_double_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, long> map = new Dictionary<double, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<double, string> Read_map_double_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, string> map = new Dictionary<double, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<double, byte[]> Read_map_double_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, byte[]> map = new Dictionary<double, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<long, bool> Read_map_long_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, bool> map = new Dictionary<long, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<long, sbyte> Read_map_long_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, sbyte> map = new Dictionary<long, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<long, byte> Read_map_long_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, byte> map = new Dictionary<long, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<long, short> Read_map_long_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, short> map = new Dictionary<long, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<long, ushort> Read_map_long_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, ushort> map = new Dictionary<long, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<long, int> Read_map_long_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, int> map = new Dictionary<long, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<long, uint> Read_map_long_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, uint> map = new Dictionary<long, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<long, float> Read_map_long_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, float> map = new Dictionary<long, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<long, double> Read_map_long_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, double> map = new Dictionary<long, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<long, long> Read_map_long_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, long> map = new Dictionary<long, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<long, string> Read_map_long_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, string> map = new Dictionary<long, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<long, byte[]> Read_map_long_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, byte[]> map = new Dictionary<long, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<string, bool> Read_map_string_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, bool> map = new Dictionary<string, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<string, sbyte> Read_map_string_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, sbyte> map = new Dictionary<string, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<string, byte> Read_map_string_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, byte> map = new Dictionary<string, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<string, short> Read_map_string_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, short> map = new Dictionary<string, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<string, ushort> Read_map_string_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, ushort> map = new Dictionary<string, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<string, int> Read_map_string_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, int> map = new Dictionary<string, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<string, uint> Read_map_string_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, uint> map = new Dictionary<string, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<string, float> Read_map_string_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, float> map = new Dictionary<string, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<string, double> Read_map_string_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, double> map = new Dictionary<string, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<string, long> Read_map_string_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, long> map = new Dictionary<string, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<string, string> Read_map_string_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, string> map = new Dictionary<string, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<string, byte[]> Read_map_string_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, byte[]> map = new Dictionary<string, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<byte[], bool> Read_map_bytes_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], bool> map = new Dictionary<byte[], bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<byte[], sbyte> Read_map_bytes_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], sbyte> map = new Dictionary<byte[], sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<byte[], byte> Read_map_bytes_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], byte> map = new Dictionary<byte[], byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<byte[], short> Read_map_bytes_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], short> map = new Dictionary<byte[], short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<byte[], ushort> Read_map_bytes_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], ushort> map = new Dictionary<byte[], ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<byte[], int> Read_map_bytes_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], int> map = new Dictionary<byte[], int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<byte[], uint> Read_map_bytes_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], uint> map = new Dictionary<byte[], uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<byte[], float> Read_map_bytes_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], float> map = new Dictionary<byte[], float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<byte[], double> Read_map_bytes_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], double> map = new Dictionary<byte[], double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<byte[], long> Read_map_bytes_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], long> map = new Dictionary<byte[], long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<byte[], string> Read_map_bytes_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], string> map = new Dictionary<byte[], string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<byte[], byte[]> Read_map_bytes_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], byte[]> map = new Dictionary<byte[], byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<bool, bool> Read_map_boolean_boolean(Dictionary<bool, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<bool, sbyte> Read_map_boolean_byte(Dictionary<bool, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<bool, byte> Read_map_boolean_ubyte(Dictionary<bool, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<bool, short> Read_map_boolean_short(Dictionary<bool, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<bool, ushort> Read_map_boolean_ushort(Dictionary<bool, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<bool, int> Read_map_boolean_int(Dictionary<bool, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<bool, uint> Read_map_boolean_uint(Dictionary<bool, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<bool, float> Read_map_boolean_float(Dictionary<bool, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<bool, double> Read_map_boolean_double(Dictionary<bool, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<bool, long> Read_map_boolean_long(Dictionary<bool, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<bool, string> Read_map_boolean_string(Dictionary<bool, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<bool, byte[]> Read_map_boolean_bytes(Dictionary<bool, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<sbyte, bool> Read_map_byte_boolean(Dictionary<sbyte, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<sbyte, sbyte> Read_map_byte_byte(Dictionary<sbyte, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<sbyte, byte> Read_map_byte_ubyte(Dictionary<sbyte, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<sbyte, short> Read_map_byte_short(Dictionary<sbyte, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<sbyte, ushort> Read_map_byte_ushort(Dictionary<sbyte, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<sbyte, int> Read_map_byte_int(Dictionary<sbyte, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<sbyte, uint> Read_map_byte_uint(Dictionary<sbyte, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<sbyte, float> Read_map_byte_float(Dictionary<sbyte, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<sbyte, double> Read_map_byte_double(Dictionary<sbyte, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<sbyte, long> Read_map_byte_long(Dictionary<sbyte, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<sbyte, string> Read_map_byte_string(Dictionary<sbyte, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<sbyte, byte[]> Read_map_byte_bytes(Dictionary<sbyte, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<byte, bool> Read_map_ubyte_boolean(Dictionary<byte, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<byte, sbyte> Read_map_ubyte_byte(Dictionary<byte, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<byte, byte> Read_map_ubyte_ubyte(Dictionary<byte, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<byte, short> Read_map_ubyte_short(Dictionary<byte, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<byte, ushort> Read_map_ubyte_ushort(Dictionary<byte, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<byte, int> Read_map_ubyte_int(Dictionary<byte, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<byte, uint> Read_map_ubyte_uint(Dictionary<byte, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<byte, float> Read_map_ubyte_float(Dictionary<byte, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<byte, double> Read_map_ubyte_double(Dictionary<byte, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<byte, long> Read_map_ubyte_long(Dictionary<byte, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<byte, string> Read_map_ubyte_string(Dictionary<byte, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<byte, byte[]> Read_map_ubyte_bytes(Dictionary<byte, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<short, bool> Read_map_short_boolean(Dictionary<short, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<short, sbyte> Read_map_short_byte(Dictionary<short, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<short, byte> Read_map_short_ubyte(Dictionary<short, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<short, short> Read_map_short_short(Dictionary<short, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<short, ushort> Read_map_short_ushort(Dictionary<short, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<short, int> Read_map_short_int(Dictionary<short, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<short, uint> Read_map_short_uint(Dictionary<short, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<short, float> Read_map_short_float(Dictionary<short, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<short, double> Read_map_short_double(Dictionary<short, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<short, long> Read_map_short_long(Dictionary<short, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<short, string> Read_map_short_string(Dictionary<short, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<short, byte[]> Read_map_short_bytes(Dictionary<short, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<ushort, bool> Read_map_ushort_boolean(Dictionary<ushort, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<ushort, sbyte> Read_map_ushort_byte(Dictionary<ushort, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<ushort, byte> Read_map_ushort_ubyte(Dictionary<ushort, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<ushort, short> Read_map_ushort_short(Dictionary<ushort, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<ushort, ushort> Read_map_ushort_ushort(Dictionary<ushort, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<ushort, int> Read_map_ushort_int(Dictionary<ushort, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<ushort, uint> Read_map_ushort_uint(Dictionary<ushort, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<ushort, float> Read_map_ushort_float(Dictionary<ushort, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<ushort, double> Read_map_ushort_double(Dictionary<ushort, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<ushort, long> Read_map_ushort_long(Dictionary<ushort, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<ushort, string> Read_map_ushort_string(Dictionary<ushort, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<ushort, byte[]> Read_map_ushort_bytes(Dictionary<ushort, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<int, bool> Read_map_int_boolean(Dictionary<int, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<int, sbyte> Read_map_int_byte(Dictionary<int, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<int, byte> Read_map_int_ubyte(Dictionary<int, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<int, short> Read_map_int_short(Dictionary<int, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<int, ushort> Read_map_int_ushort(Dictionary<int, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<int, int> Read_map_int_int(Dictionary<int, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<int, uint> Read_map_int_uint(Dictionary<int, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<int, float> Read_map_int_float(Dictionary<int, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<int, double> Read_map_int_double(Dictionary<int, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<int, long> Read_map_int_long(Dictionary<int, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<int, string> Read_map_int_string(Dictionary<int, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<int, byte[]> Read_map_int_bytes(Dictionary<int, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<uint, bool> Read_map_uint_boolean(Dictionary<uint, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<uint, sbyte> Read_map_uint_byte(Dictionary<uint, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<uint, byte> Read_map_uint_ubyte(Dictionary<uint, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<uint, short> Read_map_uint_short(Dictionary<uint, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<uint, ushort> Read_map_uint_ushort(Dictionary<uint, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<uint, int> Read_map_uint_int(Dictionary<uint, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<uint, uint> Read_map_uint_uint(Dictionary<uint, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<uint, float> Read_map_uint_float(Dictionary<uint, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<uint, double> Read_map_uint_double(Dictionary<uint, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<uint, long> Read_map_uint_long(Dictionary<uint, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<uint, string> Read_map_uint_string(Dictionary<uint, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<uint, byte[]> Read_map_uint_bytes(Dictionary<uint, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<float, bool> Read_map_float_boolean(Dictionary<float, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<float, sbyte> Read_map_float_byte(Dictionary<float, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<float, byte> Read_map_float_ubyte(Dictionary<float, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<float, short> Read_map_float_short(Dictionary<float, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<float, ushort> Read_map_float_ushort(Dictionary<float, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<float, int> Read_map_float_int(Dictionary<float, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<float, uint> Read_map_float_uint(Dictionary<float, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<float, float> Read_map_float_float(Dictionary<float, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<float, double> Read_map_float_double(Dictionary<float, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<float, long> Read_map_float_long(Dictionary<float, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<float, string> Read_map_float_string(Dictionary<float, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<float, byte[]> Read_map_float_bytes(Dictionary<float, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<double, bool> Read_map_double_boolean(Dictionary<double, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<double, sbyte> Read_map_double_byte(Dictionary<double, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<double, byte> Read_map_double_ubyte(Dictionary<double, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<double, short> Read_map_double_short(Dictionary<double, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<double, ushort> Read_map_double_ushort(Dictionary<double, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<double, int> Read_map_double_int(Dictionary<double, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<double, uint> Read_map_double_uint(Dictionary<double, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<double, float> Read_map_double_float(Dictionary<double, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<double, double> Read_map_double_double(Dictionary<double, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<double, long> Read_map_double_long(Dictionary<double, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<double, string> Read_map_double_string(Dictionary<double, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<double, byte[]> Read_map_double_bytes(Dictionary<double, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<long, bool> Read_map_long_boolean(Dictionary<long, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<long, sbyte> Read_map_long_byte(Dictionary<long, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<long, byte> Read_map_long_ubyte(Dictionary<long, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<long, short> Read_map_long_short(Dictionary<long, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<long, ushort> Read_map_long_ushort(Dictionary<long, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<long, int> Read_map_long_int(Dictionary<long, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<long, uint> Read_map_long_uint(Dictionary<long, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<long, float> Read_map_long_float(Dictionary<long, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<long, double> Read_map_long_double(Dictionary<long, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<long, long> Read_map_long_long(Dictionary<long, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<long, string> Read_map_long_string(Dictionary<long, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<long, byte[]> Read_map_long_bytes(Dictionary<long, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<string, bool> Read_map_string_boolean(Dictionary<string, bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<string, sbyte> Read_map_string_byte(Dictionary<string, sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<string, byte> Read_map_string_ubyte(Dictionary<string, byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<string, short> Read_map_string_short(Dictionary<string, short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<string, ushort> Read_map_string_ushort(Dictionary<string, ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<string, int> Read_map_string_int(Dictionary<string, int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<string, uint> Read_map_string_uint(Dictionary<string, uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<string, float> Read_map_string_float(Dictionary<string, float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<string, double> Read_map_string_double(Dictionary<string, double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<string, long> Read_map_string_long(Dictionary<string, long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<string, string> Read_map_string_string(Dictionary<string, string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<string, byte[]> Read_map_string_bytes(Dictionary<string, byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<byte[], bool> Read_map_bytes_boolean(Dictionary<byte[], bool> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<byte[], sbyte> Read_map_bytes_byte(Dictionary<byte[], sbyte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<byte[], byte> Read_map_bytes_ubyte(Dictionary<byte[], byte> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<byte[], short> Read_map_bytes_short(Dictionary<byte[], short> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<byte[], ushort> Read_map_bytes_ushort(Dictionary<byte[], ushort> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<byte[], int> Read_map_bytes_int(Dictionary<byte[], int> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<byte[], uint> Read_map_bytes_uint(Dictionary<byte[], uint> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<byte[], float> Read_map_bytes_float(Dictionary<byte[], float> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<byte[], double> Read_map_bytes_double(Dictionary<byte[], double> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<byte[], long> Read_map_bytes_long(Dictionary<byte[], long> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<byte[], string> Read_map_bytes_string(Dictionary<byte[], string> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<byte[], byte[]> Read_map_bytes_bytes(Dictionary<byte[], byte[]> map)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }

            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), _buffer.Read_bytes());
            }
            return map;
        }

        public List<bool> Read_list_boolean()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<bool> list = new List<bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_boolean());
            }
            return list;
        }

        public List<sbyte> Read_list_byte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<sbyte> list = new List<sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_byte());
            }
            return list;
        }

        public List<byte> Read_list_ubyte()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<byte> list = new List<byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_ubyte());
            }
            return list;
        }

        public List<short> Read_list_short()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<short> list = new List<short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_short());
            }
            return list;
        }

        public List<ushort> Read_list_ushort()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<ushort> list = new List<ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_ushort());
            }
            return list;
        }

        public List<int> Read_list_int()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<int> list = new List<int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_int());
            }
            return list;
        }

        public List<uint> Read_list_uint()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<uint> list = new List<uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_uint());
            }
            return list;
        }

        public List<float> Read_list_float()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<float> list = new List<float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_float());
            }
            return list;
        }

        public List<double> Read_list_double()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<double> list = new List<double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_double());
            }
            return list;
        }

        public List<long> Read_list_long()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<long> list = new List<long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_long());
            }
            return list;
        }

        public List<string> Read_list_string()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<string> list = new List<string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_string());
            }
            return list;
        }

        public List<byte[]> Read_list_bytes()
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            List<byte[]> list = new List<byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_bytes());
            }
            return list;
        }

        public List<bool> Read_list_boolean(List<bool> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_boolean());
            }
            return null;
        }

        public List<sbyte> Read_list_byte(List<sbyte> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_byte());
            }
            return null;
        }

        public List<byte> Read_list_ubyte(List<byte> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_ubyte());
            }
            return null;
        }

        public List<short> Read_list_short(List<short> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_short());
            }
            return null;
        }

        public List<ushort> Read_list_ushort(List<ushort> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_ushort());
            }
            return null;
        }

        public List<int> Read_list_int(List<int> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_int());
            }
            return null;
        }

        public List<uint> Read_list_uint(List<uint> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_uint());
            }
            return null;
        }

        public List<float> Read_list_float(List<float> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_float());
            }
            return null;
        }

        public List<double> Read_list_double(List<double> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_double());
            }
            return null;
        }

        public List<long> Read_list_long(List<long> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_long());
            }
            return null;
        }

        public List<string> Read_list_string(List<string> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_string());
            }
            return null;
        }

        public List<byte[]> Read_list_bytes(List<byte[]> list)
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.LIST)
            {
                throw new Exception("can't convert to list");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                list.Add(_buffer.Read_bytes());
            }
            return null;
        }

        public Dictionary<bool, V> Read_map_boolean_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<bool, V> map = new Dictionary<bool, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<sbyte, V> Read_map_byte_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<sbyte, V> map = new Dictionary<sbyte, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<byte, V> Read_map_ubyte_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte, V> map = new Dictionary<byte, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<short, V> Read_map_short_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<short, V> map = new Dictionary<short, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<ushort, V> Read_map_ushort_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<ushort, V> map = new Dictionary<ushort, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<int, V> Read_map_int_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<int, V> map = new Dictionary<int, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<uint, V> Read_map_uint_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<uint, V> map = new Dictionary<uint, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<float, V> Read_map_float_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<float, V> map = new Dictionary<float, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<double, V> Read_map_double_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<double, V> map = new Dictionary<double, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<long, V> Read_map_long_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<long, V> map = new Dictionary<long, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<string, V> Read_map_string_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<string, V> map = new Dictionary<string, V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<byte[], V> Read_map_bytes_pod<V>(Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<byte[], V> map = new Dictionary<byte[], V>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<bool, V> Read_map_boolean_pod<V>(Dictionary<bool, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_boolean(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<sbyte, V> Read_map_byte_pod<V>(Dictionary<sbyte, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_byte(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<byte, V> Read_map_ubyte_pod<V>(Dictionary<byte, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ubyte(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<short, V> Read_map_short_pod<V>(Dictionary<short, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_short(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<ushort, V> Read_map_ushort_pod<V>(Dictionary<ushort, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_ushort(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<int, V> Read_map_int_pod<V>(Dictionary<int, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_int(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<uint, V> Read_map_uint_pod<V>(Dictionary<uint, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_uint(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<float, V> Read_map_float_pod<V>(Dictionary<float, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_float(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<double, V> Read_map_double_pod<V>(Dictionary<double, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_double(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<long, V> Read_map_long_pod<V>(Dictionary<long, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_long(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<string, V> Read_map_string_pod<V>(Dictionary<string, V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_string(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<byte[], V> Read_map_bytes_pod<V>(Dictionary<byte[], V> map, Func<V> factory) where V : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(_buffer.Read_bytes(), Read_pod<V>(factory));
            }
            return map;
        }

        public Dictionary<K, bool> Read_map_pod_boolean<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, bool> map = new Dictionary<K, bool>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<K, sbyte> Read_map_pod_byte<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, sbyte> map = new Dictionary<K, sbyte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<K, byte> Read_map_pod_ubyte<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, byte> map = new Dictionary<K, byte>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<K, short> Read_map_pod_short<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, short> map = new Dictionary<K, short>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<K, ushort> Read_map_pod_ushort<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, ushort> map = new Dictionary<K, ushort>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<K, int> Read_map_pod_int<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, int> map = new Dictionary<K, int>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<K, uint> Read_map_pod_uint<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, uint> map = new Dictionary<K, uint>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<K, float> Read_map_pod_float<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, float> map = new Dictionary<K, float>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<K, double> Read_map_pod_double<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, double> map = new Dictionary<K, double>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<K, long> Read_map_pod_long<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, long> map = new Dictionary<K, long>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<K, string> Read_map_pod_string<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, string> map = new Dictionary<K, string>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<K, byte[]> Read_map_pod_bytes<K>(Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            Dictionary<K, byte[]> map = new Dictionary<K, byte[]>((int)length);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_bytes());
            }
            return map;
        }

        public Dictionary<K, bool> Read_map_pod_boolean<K>(Dictionary<K, bool> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_boolean());
            }
            return map;
        }

        public Dictionary<K, sbyte> Read_map_pod_byte<K>(Dictionary<K, sbyte> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_byte());
            }
            return map;
        }

        public Dictionary<K, byte> Read_map_pod_ubyte<K>(Dictionary<K, byte> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_ubyte());
            }
            return map;
        }

        public Dictionary<K, short> Read_map_pod_short<K>(Dictionary<K, short> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_short());
            }
            return map;
        }

        public Dictionary<K, ushort> Read_map_pod_ushort<K>(Dictionary<K, ushort> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_ushort());
            }
            return map;
        }

        public Dictionary<K, int> Read_map_pod_int<K>(Dictionary<K, int> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_int());
            }
            return map;
        }

        public Dictionary<K, uint> Read_map_pod_uint<K>(Dictionary<K, uint> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_uint());
            }
            return map;
        }

        public Dictionary<K, float> Read_map_pod_float<K>(Dictionary<K, float> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_float());
            }
            return map;
        }

        public Dictionary<K, double> Read_map_pod_double<K>(Dictionary<K, double> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_double());
            }
            return map;
        }

        public Dictionary<K, long> Read_map_pod_long<K>(Dictionary<K, long> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_long());
            }
            return map;
        }

        public Dictionary<K, string> Read_map_pod_string<K>(Dictionary<K, string> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_string());
            }
            return map;
        }

        public Dictionary<K, byte[]> Read_map_pod_bytes<K>(Dictionary<K, byte[]> map, Func<K> factory) where K : IPOD
        {
            byte identity = _buffer.Read();
            if (identity == SType.NULL)
            {
                return null;
            }
            if ((byte)(identity & 0xf0) != SType.MAP)
            {
                throw new Exception("can't convert to map");
            }
            uint length = _buffer.ReadSize(identity);
            for (uint i = 0; i < length; i++)
            {
                map.Add(Read_pod<K>(factory), _buffer.Read_bytes());
            }
            return map;
        }


        #endregion

    }
}

